-- creator_bonus
-- create by zhuangsl
-- 道具：  时光の钥

return {
    apply = function(source, target, classId, value)
        local level = 1;

        -- 时之术士专属加强效果
        local prop = PropM.combine(source, "time", 48);
        level = PropM.apply(prop, level);

        -- 奖励
        local arr;
        for i = 1, level do
            arr = value[i];
            if arr[1] == 1 then
                --物品奖励
                BonusM.doBonus(arr, "apply_property");
            elseif arr[1] == 2 then
                --属性奖励，默认为百分比增加,至少1点
                local count = math.modf(InterfaceM.calcBaseAttrib(source, arr[2]) * arr[3] / 1000);
                count = math.max(count, 1);
                BonusM.doBonus({arr[1], arr[2], count}, "apply_property");
            end
        end
    end,
};
